<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Hardware Abstraction Layer (HAL)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="logo.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Hardware Abstraction Layer (HAL)</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__group__hal__usb__dev__endpoint.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">Endpoint<div class="ingroups"><a class="el" href="group__group__hal.html">HAL Drivers</a> &raquo; <a class="el" href="group__group__hal__usb__dev.html">USB Device</a></div></div></div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p >APIs relating to endpoint management. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga692c047c9e8dd81883b52c43ef9c7f81"><td class="memItemLeft" align="right" valign="top"><a id="ga692c047c9e8dd81883b52c43ef9c7f81" name="ga692c047c9e8dd81883b52c43ef9c7f81"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CYHAL_USB_DEV_IS_IN_EP</b>(endpoint)&#160;&#160;&#160;(0U != (0x80U &amp; (uint32_t) (endpoint)))</td></tr>
<tr class="memdesc:ga692c047c9e8dd81883b52c43ef9c7f81"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if endpoint direction is IN. <br /></td></tr>
<tr class="separator:ga692c047c9e8dd81883b52c43ef9c7f81"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa077cda11942124fc133e6637057f58b"><td class="memItemLeft" align="right" valign="top"><a id="gaa077cda11942124fc133e6637057f58b" name="gaa077cda11942124fc133e6637057f58b"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CYHAL_USB_DEV_GET_EP_NUM</b>(endpoint)&#160;&#160;&#160;((uint32_t) (endpoint) &amp; 0x0FU)</td></tr>
<tr class="memdesc:gaa077cda11942124fc133e6637057f58b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns endpoint number (type uint32_t) <br /></td></tr>
<tr class="separator:gaa077cda11942124fc133e6637057f58b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga17dc71e801edbd6b7d120319e1185505"><td class="memItemLeft" align="right" valign="top"><a id="ga17dc71e801edbd6b7d120319e1185505" name="ga17dc71e801edbd6b7d120319e1185505"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CYHAL_USB_DEV_GET_EP_IDX</b>(endpoint)&#160;&#160;&#160;(<a class="el" href="group__group__hal__usb__dev__endpoint.html#gaa077cda11942124fc133e6637057f58b">CYHAL_USB_DEV_GET_EP_NUM</a>(endpoint) - 1U)</td></tr>
<tr class="memdesc:ga17dc71e801edbd6b7d120319e1185505"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns endpoint index (type uint32_t) <br /></td></tr>
<tr class="separator:ga17dc71e801edbd6b7d120319e1185505"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:gaa050c9639ab34294735f8ef572b9e417"><td class="memItemLeft" align="right" valign="top"><a id="gaa050c9639ab34294735f8ef572b9e417" name="gaa050c9639ab34294735f8ef572b9e417"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__usb__dev__endpoint.html#gaa050c9639ab34294735f8ef572b9e417">cyhal_usb_dev_ep_type_t</a> { <br />
&#160;&#160;<b>CYHAL_USB_DEV_EP_TYPE_CTRL</b> = 0
, <br />
&#160;&#160;<b>CYHAL_USB_DEV_EP_TYPE_ISO</b> = 1
, <br />
&#160;&#160;<b>CYHAL_USB_DEV_EP_TYPE_BULK</b> = 2
, <br />
&#160;&#160;<b>CYHAL_USB_DEV_EP_TYPE_INT</b> = 3
<br />
 }</td></tr>
<tr class="memdesc:gaa050c9639ab34294735f8ef572b9e417"><td class="mdescLeft">&#160;</td><td class="mdescRight">USB Device Endpoints types. <br /></td></tr>
<tr class="separator:gaa050c9639ab34294735f8ef572b9e417"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga19afd43bcec6dc1c3a54cc3d3620bdcf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__usb__dev__endpoint.html#ga19afd43bcec6dc1c3a54cc3d3620bdcf">cyhal_usb_dev_endpoint_add</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *obj, bool alloc, bool enable, <a class="el" href="group__group__hal__usb__dev__common.html#ga62a268fe35f5e68f1faf9b362ee6c307">cyhal_usb_dev_ep_t</a> endpoint, uint32_t max_packet, <a class="el" href="group__group__hal__usb__dev__endpoint.html#gaa050c9639ab34294735f8ef572b9e417">cyhal_usb_dev_ep_type_t</a> type)</td></tr>
<tr class="memdesc:ga19afd43bcec6dc1c3a54cc3d3620bdcf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configure an endpoint.  <a href="group__group__hal__usb__dev__endpoint.html#ga19afd43bcec6dc1c3a54cc3d3620bdcf">More...</a><br /></td></tr>
<tr class="separator:ga19afd43bcec6dc1c3a54cc3d3620bdcf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga45dbdfed4128948d62e06dd95e59429e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__usb__dev__endpoint.html#ga45dbdfed4128948d62e06dd95e59429e">cyhal_usb_dev_endpoint_remove</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *obj, <a class="el" href="group__group__hal__usb__dev__common.html#ga62a268fe35f5e68f1faf9b362ee6c307">cyhal_usb_dev_ep_t</a> endpoint)</td></tr>
<tr class="memdesc:ga45dbdfed4128948d62e06dd95e59429e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disable an endpoint.  <a href="group__group__hal__usb__dev__endpoint.html#ga45dbdfed4128948d62e06dd95e59429e">More...</a><br /></td></tr>
<tr class="separator:ga45dbdfed4128948d62e06dd95e59429e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7efab105262969a4c711012bbc636bc6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__usb__dev__endpoint.html#ga7efab105262969a4c711012bbc636bc6">cyhal_usb_dev_endpoint_stall</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *obj, <a class="el" href="group__group__hal__usb__dev__common.html#ga62a268fe35f5e68f1faf9b362ee6c307">cyhal_usb_dev_ep_t</a> endpoint)</td></tr>
<tr class="memdesc:ga7efab105262969a4c711012bbc636bc6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Perform a functional stall on the given endpoint.  <a href="group__group__hal__usb__dev__endpoint.html#ga7efab105262969a4c711012bbc636bc6">More...</a><br /></td></tr>
<tr class="separator:ga7efab105262969a4c711012bbc636bc6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3377902d254aacd757319ed677467bb3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__usb__dev__endpoint.html#ga3377902d254aacd757319ed677467bb3">cyhal_usb_dev_endpoint_unstall</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *obj, <a class="el" href="group__group__hal__usb__dev__common.html#ga62a268fe35f5e68f1faf9b362ee6c307">cyhal_usb_dev_ep_t</a> endpoint)</td></tr>
<tr class="memdesc:ga3377902d254aacd757319ed677467bb3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unstall the endpoint.  <a href="group__group__hal__usb__dev__endpoint.html#ga3377902d254aacd757319ed677467bb3">More...</a><br /></td></tr>
<tr class="separator:ga3377902d254aacd757319ed677467bb3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4f969f88c334c12e5a3975bda054b248"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__usb__dev__endpoint.html#ga4f969f88c334c12e5a3975bda054b248">cyhal_usb_dev_endpoint_is_stalled</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *obj, <a class="el" href="group__group__hal__usb__dev__common.html#ga62a268fe35f5e68f1faf9b362ee6c307">cyhal_usb_dev_ep_t</a> endpoint)</td></tr>
<tr class="memdesc:ga4f969f88c334c12e5a3975bda054b248"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the endpoint stall state.  <a href="group__group__hal__usb__dev__endpoint.html#ga4f969f88c334c12e5a3975bda054b248">More...</a><br /></td></tr>
<tr class="separator:ga4f969f88c334c12e5a3975bda054b248"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa5a6c78cc7a6cb089373986cf557b6e9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__usb__dev__endpoint.html#gaa5a6c78cc7a6cb089373986cf557b6e9">cyhal_usb_dev_endpoint_read</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *obj, <a class="el" href="group__group__hal__usb__dev__common.html#ga62a268fe35f5e68f1faf9b362ee6c307">cyhal_usb_dev_ep_t</a> endpoint, uint8_t *data, uint32_t size)</td></tr>
<tr class="memdesc:gaa5a6c78cc7a6cb089373986cf557b6e9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start a read on the given endpoint.  <a href="group__group__hal__usb__dev__endpoint.html#gaa5a6c78cc7a6cb089373986cf557b6e9">More...</a><br /></td></tr>
<tr class="separator:gaa5a6c78cc7a6cb089373986cf557b6e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2739d5c3160be023a33cbaaf7ea08bc0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__usb__dev__endpoint.html#ga2739d5c3160be023a33cbaaf7ea08bc0">cyhal_usb_dev_endpoint_read_result</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *obj, <a class="el" href="group__group__hal__usb__dev__common.html#ga62a268fe35f5e68f1faf9b362ee6c307">cyhal_usb_dev_ep_t</a> endpoint, uint32_t *act_size)</td></tr>
<tr class="memdesc:ga2739d5c3160be023a33cbaaf7ea08bc0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finish a read on the given endpoint.  <a href="group__group__hal__usb__dev__endpoint.html#ga2739d5c3160be023a33cbaaf7ea08bc0">More...</a><br /></td></tr>
<tr class="separator:ga2739d5c3160be023a33cbaaf7ea08bc0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga54f6b481864a40165d643ad67900d0b7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__usb__dev__endpoint.html#ga54f6b481864a40165d643ad67900d0b7">cyhal_usb_dev_endpoint_write</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *obj, <a class="el" href="group__group__hal__usb__dev__common.html#ga62a268fe35f5e68f1faf9b362ee6c307">cyhal_usb_dev_ep_t</a> endpoint, uint8_t const *data, uint32_t size)</td></tr>
<tr class="memdesc:ga54f6b481864a40165d643ad67900d0b7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start a write on the given endpoint.  <a href="group__group__hal__usb__dev__endpoint.html#ga54f6b481864a40165d643ad67900d0b7">More...</a><br /></td></tr>
<tr class="separator:ga54f6b481864a40165d643ad67900d0b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga38b4dec1035874e64c9df78718bdc99c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__usb__dev__endpoint.html#ga38b4dec1035874e64c9df78718bdc99c">cyhal_usb_dev_endpoint_abort</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *obj, <a class="el" href="group__group__hal__usb__dev__common.html#ga62a268fe35f5e68f1faf9b362ee6c307">cyhal_usb_dev_ep_t</a> endpoint)</td></tr>
<tr class="memdesc:ga38b4dec1035874e64c9df78718bdc99c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Abort the current transfer if it has not yet been sent.  <a href="group__group__hal__usb__dev__endpoint.html#ga38b4dec1035874e64c9df78718bdc99c">More...</a><br /></td></tr>
<tr class="separator:ga38b4dec1035874e64c9df78718bdc99c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga128a701f82f6250a3a907f417959182e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__usb__dev__endpoint.html#ga128a701f82f6250a3a907f417959182e">cyhal_usb_dev_register_endpoint_callback</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *obj, <a class="el" href="group__group__hal__usb__dev__common.html#ga62a268fe35f5e68f1faf9b362ee6c307">cyhal_usb_dev_ep_t</a> endpoint, <a class="el" href="group__group__hal__usb__dev__common.html#ga88241f53490fed2cce33872947c67053">cyhal_usb_dev_endpoint_callback_t</a> callback)</td></tr>
<tr class="memdesc:ga128a701f82f6250a3a907f417959182e"><td class="mdescLeft">&#160;</td><td class="mdescRight">The USB Device endpoint complete callback handler registration.  <a href="group__group__hal__usb__dev__endpoint.html#ga128a701f82f6250a3a907f417959182e">More...</a><br /></td></tr>
<tr class="separator:ga128a701f82f6250a3a907f417959182e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga19afd43bcec6dc1c3a54cc3d3620bdcf" name="ga19afd43bcec6dc1c3a54cc3d3620bdcf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga19afd43bcec6dc1c3a54cc3d3620bdcf">&#9670;&nbsp;</a></span>cyhal_usb_dev_endpoint_add()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_usb_dev_endpoint_add </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>alloc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>enable</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__usb__dev__common.html#ga62a268fe35f5e68f1faf9b362ee6c307">cyhal_usb_dev_ep_t</a>&#160;</td>
          <td class="paramname"><em>endpoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>max_packet</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__usb__dev__endpoint.html#gaa050c9639ab34294735f8ef572b9e417">cyhal_usb_dev_ep_type_t</a>&#160;</td>
          <td class="paramname"><em>type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Configure an endpoint. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The USB device object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">alloc</td><td>True to allocates buffer for the endpoint, false to skip allocation </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">enable</td><td>True to enable endpoint operation, false to skip enablement </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">endpoint</td><td>Endpoint to configure and enable </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">max_packet</td><td>The maximum packet size that can be sent or received </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">type</td><td>The type of endpoint (does not care when enable parameter is false)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the endpoint add request</dd></dl>
<dl class="section note"><dt>Note</dt><dd><ul>
<li>This function cannot be used to configure endpoint 0. That must be done with cyhal_usb_dev_ep0_get_max_packet.</li>
<li>After endpoint was enabled it must be removed with cyhal_usb_dev_endpoint_remove and then enabled again. </li>
</ul>
</dd></dl>

</div>
</div>
<a id="ga45dbdfed4128948d62e06dd95e59429e" name="ga45dbdfed4128948d62e06dd95e59429e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga45dbdfed4128948d62e06dd95e59429e">&#9670;&nbsp;</a></span>cyhal_usb_dev_endpoint_remove()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_usb_dev_endpoint_remove </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__usb__dev__common.html#ga62a268fe35f5e68f1faf9b362ee6c307">cyhal_usb_dev_ep_t</a>&#160;</td>
          <td class="paramname"><em>endpoint</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Disable an endpoint. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The USB device object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">endpoint</td><td>Endpoint to disable</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the endpoint remove request </dd></dl>

</div>
</div>
<a id="ga7efab105262969a4c711012bbc636bc6" name="ga7efab105262969a4c711012bbc636bc6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7efab105262969a4c711012bbc636bc6">&#9670;&nbsp;</a></span>cyhal_usb_dev_endpoint_stall()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_usb_dev_endpoint_stall </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__usb__dev__common.html#ga62a268fe35f5e68f1faf9b362ee6c307">cyhal_usb_dev_ep_t</a>&#160;</td>
          <td class="paramname"><em>endpoint</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Perform a functional stall on the given endpoint. </p>
<p >Set the HALT feature for this endpoint so that all further communication is aborted.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The USB device object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">endpoint</td><td>Endpoint to stall</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the endpoint stall request </dd></dl>

</div>
</div>
<a id="ga3377902d254aacd757319ed677467bb3" name="ga3377902d254aacd757319ed677467bb3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3377902d254aacd757319ed677467bb3">&#9670;&nbsp;</a></span>cyhal_usb_dev_endpoint_unstall()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_usb_dev_endpoint_unstall </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__usb__dev__common.html#ga62a268fe35f5e68f1faf9b362ee6c307">cyhal_usb_dev_ep_t</a>&#160;</td>
          <td class="paramname"><em>endpoint</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Unstall the endpoint. </p>
<p >Clear the HALT feature on this endpoint so communication can resume.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The USB device object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">endpoint</td><td>Endpoint to stall</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the endpoint unstall request </dd></dl>

</div>
</div>
<a id="ga4f969f88c334c12e5a3975bda054b248" name="ga4f969f88c334c12e5a3975bda054b248"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4f969f88c334c12e5a3975bda054b248">&#9670;&nbsp;</a></span>cyhal_usb_dev_endpoint_is_stalled()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cyhal_usb_dev_endpoint_is_stalled </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__usb__dev__common.html#ga62a268fe35f5e68f1faf9b362ee6c307">cyhal_usb_dev_ep_t</a>&#160;</td>
          <td class="paramname"><em>endpoint</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return the endpoint stall state. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The USB device object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">endpoint</td><td>Endpoint to check stall state</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if endpoint stalled, false otherwise. </dd></dl>

</div>
</div>
<a id="gaa5a6c78cc7a6cb089373986cf557b6e9" name="gaa5a6c78cc7a6cb089373986cf557b6e9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa5a6c78cc7a6cb089373986cf557b6e9">&#9670;&nbsp;</a></span>cyhal_usb_dev_endpoint_read()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_usb_dev_endpoint_read </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__usb__dev__common.html#ga62a268fe35f5e68f1faf9b362ee6c307">cyhal_usb_dev_ep_t</a>&#160;</td>
          <td class="paramname"><em>endpoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Start a read on the given endpoint. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The USB device object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">endpoint</td><td>Endpoint to start the read on </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>Buffer to fill with data </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Size of the read buffer. This must be at least the max packet size for this endpoint.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of start a read operation </dd></dl>

</div>
</div>
<a id="ga2739d5c3160be023a33cbaaf7ea08bc0" name="ga2739d5c3160be023a33cbaaf7ea08bc0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2739d5c3160be023a33cbaaf7ea08bc0">&#9670;&nbsp;</a></span>cyhal_usb_dev_endpoint_read_result()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_usb_dev_endpoint_read_result </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__usb__dev__common.html#ga62a268fe35f5e68f1faf9b362ee6c307">cyhal_usb_dev_ep_t</a>&#160;</td>
          <td class="paramname"><em>endpoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>act_size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Finish a read on the given endpoint. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The USB device object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">endpoint</td><td>Endpoint to check </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">act_size</td><td>Actual number of bytes that was read</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of a finish read </dd></dl>

</div>
</div>
<a id="ga54f6b481864a40165d643ad67900d0b7" name="ga54f6b481864a40165d643ad67900d0b7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga54f6b481864a40165d643ad67900d0b7">&#9670;&nbsp;</a></span>cyhal_usb_dev_endpoint_write()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_usb_dev_endpoint_write </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__usb__dev__common.html#ga62a268fe35f5e68f1faf9b362ee6c307">cyhal_usb_dev_ep_t</a>&#160;</td>
          <td class="paramname"><em>endpoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t const *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Start a write on the given endpoint. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The USB device object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">endpoint</td><td>Endpoint to write to </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>Buffer to write </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Size of data to write</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of a write request </dd></dl>

</div>
</div>
<a id="ga38b4dec1035874e64c9df78718bdc99c" name="ga38b4dec1035874e64c9df78718bdc99c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga38b4dec1035874e64c9df78718bdc99c">&#9670;&nbsp;</a></span>cyhal_usb_dev_endpoint_abort()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_usb_dev_endpoint_abort </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__usb__dev__common.html#ga62a268fe35f5e68f1faf9b362ee6c307">cyhal_usb_dev_ep_t</a>&#160;</td>
          <td class="paramname"><em>endpoint</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Abort the current transfer if it has not yet been sent. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The USB device object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">endpoint</td><td>Endpoint to abort the transfer on. It is implementation defined if this function has an effect on receive endpoints.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of an abort request</dd></dl>
<dl class="section note"><dt>Note</dt><dd>For the ISOC endpoints in pending state this function does not wait for bus activity completion because these endpoints do not have handshake and are always accessible to the Host. Therefore it is safe to call this function for ISOC endpoint when the Host will not access them during abort. </dd></dl>

</div>
</div>
<a id="ga128a701f82f6250a3a907f417959182e" name="ga128a701f82f6250a3a907f417959182e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga128a701f82f6250a3a907f417959182e">&#9670;&nbsp;</a></span>cyhal_usb_dev_register_endpoint_callback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_usb_dev_register_endpoint_callback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__usb__dev__common.html#ga62a268fe35f5e68f1faf9b362ee6c307">cyhal_usb_dev_ep_t</a>&#160;</td>
          <td class="paramname"><em>endpoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__usb__dev__common.html#ga88241f53490fed2cce33872947c67053">cyhal_usb_dev_endpoint_callback_t</a>&#160;</td>
          <td class="paramname"><em>callback</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The USB Device endpoint complete callback handler registration. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The USB device object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">endpoint</td><td>Endpoint to registers handler </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>The callback handler which will be invoked when the endpoint comp </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>Hardware Abstraction Layer (HAL)</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
